<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>基本网格布局</title>
</head>

<body>
    <div class="Grid">
        <div class="Grid-cell">1/1</div>
    </div>
    <div class="Grid">
        <div class="Grid-cell">1/2</div>
        <div class="Grid-cell">1/2</div>
    </div>
    <div class="Grid">
        <div class="Grid-cell">1/3</div>
        <div class="Grid-cell">1/3</div>
        <div class="Grid-cell">1/3</div>
    </div>
    <div class="Grid">
        <div class="Grid-cell">1/4</div>
        <div class="Grid-cell">1/4</div>
        <div class="Grid-cell">1/4</div>
        <div class="Grid-cell">1/4</div>
    </div>
    <div class="Grid">
        <div class="Grid-cell">1/5</div>
        <div class="Grid-cell">1/5</div>
        <div class="Grid-cell">1/5</div>
        <div class="Grid-cell">1/5</div>
        <div class="Grid-cell">1/5</div>
    </div>
    <div class="Grid">
        <div class="Grid-cell">1/6</div>
        <div class="Grid-cell">1/6</div>
        <div class="Grid-cell">1/6</div>
        <div class="Grid-cell">1/6</div>
        <div class="Grid-cell">1/6</div>
        <div class="Grid-cell">1/6</div>
    </div>

    <style>
        .Grid {
            display: flex;

        }

        .Grid-cell {
            flex: 1;
            background: #eee;
            margin: 10px;
        }

        .Grid {
            text-align: center;
        }

        /*奇数*/
        .Grid :nth-child(odd) {
            background-color: tomato;
        }

        /*偶数*/
        .Grid :nth-child(even) {
            background-color: teal;
        }
    </style>
</body>

</html>